fix: add comprehensive tests for truncated JSON repair (#186)#213
Merged
Conversation
- 10 new unit tests for repair_truncated_json covering: - Unclosed strings, arrays, objects - Nested structures with unclosed brackets - Strings with escaped quotes - Multiple unclosed brackets - Truncation after complete first item - Empty array edge case - Already-valid JSON passthrough - 2 new end-to-end tests for parse_review_response and parse_scan_response with truncated input - Confirms existing repair_truncated_json implementation works correctly — only lacked test coverage Closes #186
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
repair_truncated_json()function already existed and worked, but had zero test coverage. This adds 12 tests confirming correct behavior.Changes
10 unit tests for
repair_truncated_json:2 end-to-end integration tests:
parse_review_responsewith truncated JSON inputparse_scan_responsewith truncated JSON inputVerification
Closes #186